package com.yboot.module.system.model.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.yboot.starter.common.core.web.validation.InsertGroup;
import com.yboot.starter.common.core.web.validation.UpdateGroup;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.time.LocalDateTime;

import lombok.Data;

/**
 * 用户社会化关联表
 * @author yangcs
 * @date 2025-08-29
 */
@Data
public class SysUserSocialDto implements Serializable {
    private static final long serialVersionUID = 1L;
    /**
     * ID
     */
    @NotBlank(message = "id不能为空", groups = {UpdateGroup.class})
    private String id;
    /**
     * 来源
     */
    @NotBlank(message = "source不能为空", groups = {InsertGroup.class, UpdateGroup.class})
    private String source;
    /**
     * 开放ID
     */
    @NotBlank(message = "openId不能为空", groups = {InsertGroup.class, UpdateGroup.class})
    private String openId;
    /**
     * 用户ID
     */
    @NotBlank(message = "userId不能为空", groups = {InsertGroup.class, UpdateGroup.class})
    private String userId;
    /**
     * 附加信息
     */
    private String metaJson;
    /**
     * 最后登录时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime lastLoginTime;
}
